const baseURL = "  "

const Request = (options) => {
  return new Promise((resolve, reject) => {
    wx.request({
      url: baseURL + options.url || '',
      data: options.data || {},
      method: options.method || 'POST',
      header: {
        'content-type': "application/x-www-form-urlencoded"
      },
      responseType: options.responseType || "",
      timeout: 15000,
      success(res) {
        resolve(res.data);
      },
      fail(res) {
        reject(res);
      }
    })
  })
};

module.exports = {
  Request
};